package atomic;

import java.util.concurrent.atomic.AtomicInteger;

public class AbaProblem {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(10);

        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                atomicInteger.set(11);

                atomicInteger.set(10);
            }
        });
        thread.setName("child");
        thread.start();

        int i = atomicInteger.get();
        atomicInteger.compareAndSet(i,0);
        System.out.println(atomicInteger.get());
    }
}
